package com.vftour.stu.sentinel.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.vftour.micro.common.utils.R;
import org.springframework.web.bind.annotation.*;

/**
 * TestController
 *
 * @version 1.0
 * @author: 东东 | d@tke.store
 * @date :  2022/3/5 10:42 下午
 */
@RestController
@RequestMapping("sentinel/test")
public class TestController {

    @SentinelResource("hot")
    @GetMapping("{id}")
    public R getId(@PathVariable("id") int id) {
        return R.ok().put("id", id);
    }


    @GetMapping("/query")
    public R testQuery() {
        return R.ok("查询");
    }

    @RequestMapping("/save")
    public R save() {
        return R.ok("保存成功");
    }
}
